import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    Authorization: sessionStorage.getItem('token') ? sessionStorage.getItem('token') : '',
    Authority: null
  },
  getters: {
  },
  mutations: {
    changeLogin (state, user) {
      state.Authorization = user.Authorization
      sessionStorage.setItem('token', user.Authorization)
    },
    AuthorityTrue (state) {
      this.state.Authority = true
    },
    AuthorityFalse (state) {
      this.state.Authority = false
    }

  },
  actions: {
  },
  modules: {
  }
})
